package test.ui {
	import gear.core.Game;
	import gear.net.LibData;
	import gear.net.RESManager;
	import gear.net.SWFLoader;
	import gear.ui.controls.GAlert;
	import gear.ui.data.GAlertData;
	import gear.ui.manager.UIManager;

	import flash.events.Event;

	/**
	 * 测试对话框控件
	 * 
	 * @author bright
	 * @version 20101027
	 */
	[SWF(width=550,height=400,backgroundColor=0x333333,frameRate=48)]
	public class TestGAlert extends Game {
		override protected function startup() : void {
			RESManager.instance.add(new SWFLoader(new LibData("assets/ui.swf")));
			RESManager.instance.addEventListener(Event.COMPLETE, res_completeHandler);
			RESManager.instance.load();
		}

		private function res_completeHandler(event : Event) : void {
			RESManager.instance.removeEventListener(Event.COMPLETE, res_completeHandler);
			addAlert();
		}

		private function addAlert() : void {
			var data : GAlertData = new GAlertData();
			data.parent = UIManager.root;
			data.cancelLabel = "Choose again";
			data.okLabel = "Accept";
			data.labelData.width = 300;
			data.labelData.text = "Are you sure to choose this isle type? Once confirmed your choice.it will not be able to change.";
			data.flag = GAlert.OK | GAlert.CANCEL;
			var alert : GAlert = new GAlert(data);
			alert.show();
		}

		public function TestGAlert() {
		}
	}
}
